
Imports System.Drawing
Imports System.Drawing.Drawing2D

Imports cmplib01
Imports FMPLib01


Public Class frmBattleResolution
    Const WM_NCHITTEST As Integer = &H84
    Const HTCLIENT As Integer = &H1
    Const HTCAPTION As Integer = &H2

    Private GameTitle As String = "Combat Resolution"
    Private headerFont As New Font("Cambria", 16)

    Private _cmp As CampaignerGameData
    Private _fmp As FlexMapData

    Public Overloads Sub ShowDialog(ByRef cmp As CampaignerGameData, ByRef fmp As FlexMapData, ByRef mapbmp As Bitmap)
        _cmp = cmp
        _fmp = fmp
        eocCombat.MapData = _fmp
        eocCombat.MapBMP = mapbmp
        eocCombat.GameData = _cmp

    End Sub

    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        Select Case m.Msg
            Case WM_NCHITTEST
                MyBase.WndProc(m)
                If (m.Result.ToInt32 = HTCLIENT) Then
                    m.Result = IntPtr.op_Explicit(HTCAPTION)
                End If
                Exit Sub
        End Select
        MyBase.WndProc(m)
    End Sub

    Private Sub Client_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        e.Graphics.FillRectangle(New LinearGradientBrush(New Point(4, 4), New Point(Me.Width + 10, Me.Height), Color.DarkGoldenrod, Color.Yellow), New RectangleF(4, 4, Me.Width + 10, 36))
        e.Graphics.DrawImage(My.Resources.goldleftendcap, 4, 3)
        e.Graphics.DrawImage(My.Resources.campaigner, 12, 14)
        e.Graphics.DrawString(GameTitle, headerFont, Brushes.Black, 36, 8)
    End Sub


    Private Sub CtlEndOfCombatPhase1_ApplyCombatResults() Handles eocCombat.ApplyCombatResults

    End Sub
End Class